﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:local="clr-namespace:WpfApplicationExperimental"
	xmlns:Custom="http://schemas.microsoft.com/wpf/2008/toolkit">

    <!-- Resource dictionary entries should be defined here. -->

    <!-- CONTENT AREA HEADER STYLE this is for main grid-->
    <Style x:Key="styleContentAreaHeader">
        <Setter Property="Border.CornerRadius" Value="10" />
        <Setter Property="Control.Height" Value="40" />
        <Setter Property="Control.Margin" Value="1,1,1,6" />
    </Style>
    <!--
  *****************************************************************************
  BRUSHES
  *****************************************************************************
  -->

    <!-- #Brushes -->
    <LinearGradientBrush x:Key="DataGridHeaderBackgroundBrush" EndPoint="0,1" StartPoint="0,0">
    	<GradientStop Color="#FF202041" Offset="0"/>
    	<GradientStop Color="#FF0D6BF5" Offset="1"/>
    	<GradientStop Color="#FF1971DB" Offset="0.88"/>
    	<GradientStop Color="#FF136EE6" Offset="0.935"/>
    	<GradientStop Color="#FF0E6BF0" Offset="0.98"/>
    	<GradientStop Color="#FF0E6BF0" Offset="0.98"/>
    	<GradientStop Color="#19092852" Offset="1"/>
    </LinearGradientBrush>

    <SolidColorBrush x:Key="DataGridHeaderMouseOverBackgroundBrush" Color="#660D6BF5"/>


    <SolidColorBrush x:Key="DataGridHeaderBorderBrush" Color="#FF000000"/>

    <LinearGradientBrush x:Key="DataGridHeaderSortedBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#B58801" Offset="0" />
        <GradientStop Color="#681900" Offset="1" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="DataGridHeaderSortedBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#C46007" Offset="0" />
        <GradientStop Color="#AF2600" Offset="1" />
    </LinearGradientBrush>


    <SolidColorBrush x:Key="DataGridBackgroundBrush" Color="#FFFFFFFF" />
    <SolidColorBrush x:Key="DataGridSelectedBrush" Color="#3E4955" />

    <SolidColorBrush x:Key="DataGridSelectedForegroundBrush" Color="#FFFFFF" />

    <!--<SolidColorBrush x:Key="RowBackgroundAlternateBrush" Color="#F4F4EE" />-->



    <SolidColorBrush x:Key="DataGridValidationForegroundBrush" Color="Red" />
    <SolidColorBrush x:Key="DataGridValidationBackgroundBrush" Color="Transparent" />





    <!-- 	
    <SolidColorBrush x:Key="RowBackgroundBrush" Color="#BBF6FFE0" /> 
    <SolidColorBrush x:Key="RowBackgroundAlternateBrush" Color="#BBBDD684" />
	<SolidColorBrush x:Key="RowBackgroundAlternationIndex2Brush" Color="#BBE2F0D6" /> 
	<SolidColorBrush x:Key="RowBackgroundAlternationIndex3Brush" Color="#BB95AB63" /> 
	-->




    <SolidColorBrush x:Key="RowBackgroundBrush" Color="#44362A3D" />
    <SolidColorBrush x:Key="RowBackgroundAlternateBrush" Color="#443A4149" />
    <SolidColorBrush x:Key="RowBackgroundAlternationIndex2Brush" Color="#441D2227" />
    <SolidColorBrush x:Key="RowBackgroundAlternationIndex3Brush" Color="#44CCCCCC" />


    <SolidColorBrush x:Key="DataGridHorizontalLinesBrush" Color="Black" />


    <SolidColorBrush x:Key="RowHeaderIsMouseOverBrush" Color="#3E4955" />
    <LinearGradientBrush x:Key="XXXDataGridHeaderSortedBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#B58801" Offset="0" />
        <GradientStop Color="#681900" Offset="1" />
    </LinearGradientBrush>


    <LinearGradientBrush x:Key="RowBackgroundSelectedBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#4F8CC7" Offset="0" />
        <GradientStop Color="#1C4B7C" Offset="0.7" />
        <GradientStop Color="#042D5B" Offset="1" />
    </LinearGradientBrush>



    <!--<SolidColorBrush x:Key="RowHeaderSelectedBrush" Color="Red" />-->
    <SolidColorBrush x:Key="RowHeaderBackgroundBrush" Color="AliceBlue" />


    <BooleanToVisibilityConverter x:Key="bool2VisibilityConverter" />



    <!-- CONFIRMED USED IN BLOG POST -->


    <!--<Style x:Key="CopyOfDataGridRowMinusBackgroundStyle" TargetType="{x:Type Custom:DataGridRow}">        
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="Validation.ErrorTemplate" Value="{x:Null}" />         
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Custom:DataGridRow}">
                    <Border x:Name="DGR_Border"
                  Background="{TemplateBinding Background}"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}"
                  SnapsToDevicePixels="True">
                        <Custom:SelectiveScrollingGrid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>

                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <Custom:DataGridCellsPresenter Grid.Column="1"
                                         ItemsPanel="{TemplateBinding ItemsPanel}"
                                         SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>

                            <Custom:DataGridDetailsPresenter  Custom:SelectiveScrollingGrid.SelectiveScrollingOrientation="{Binding RelativeSource={RelativeSource AncestorType={x:Type Custom:DataGrid}}, Path=AreRowDetailsFrozen, Converter={x:Static Custom:DataGrid.RowDetailsScrollingConverter}, ConverterParameter={x:Static Custom:SelectiveScrollingOrientation.Vertical}}"
                                            Grid.Column="1" Grid.Row="1"
                                            Visibility="{TemplateBinding DetailsVisibility}" />

                            <Custom:DataGridRowHeader Custom:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"  Grid.RowSpan="2"
                                    Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type Custom:DataGrid}}, Path=HeadersVisibility, Converter={x:Static Custom:DataGrid.HeadersVisibilityConverter}, ConverterParameter={x:Static Custom:DataGridHeadersVisibility.Row}}"/>
                        </Custom:SelectiveScrollingGrid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
   
    </Style>-->


    <Style x:Key="DataGridRowStyle" TargetType="{x:Type Custom:DataGridRow}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Custom:DataGridRow}">
                    <Border 
              x:Name="DGR_Border"
              Background="{TemplateBinding Background}"
              BorderBrush="{TemplateBinding BorderBrush}"
              BorderThickness="{TemplateBinding BorderThickness}"
              SnapsToDevicePixels="True">
                        <Custom:SelectiveScrollingGrid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Custom:DataGridCellsPresenter 
                  Grid.Column="1"
                   ItemsPanel="{TemplateBinding ItemsPanel}"
                   SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            <Custom:DataGridRowHeader x:Name="RowHeader"
                  Custom:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"  
                  Grid.RowSpan="2"
                  Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type Custom:DataGrid}}, 
                               Path=HeadersVisibility, Converter={x:Static Custom:DataGrid.HeadersVisibilityConverter}, ConverterParameter={x:Static Custom:DataGridHeadersVisibility.Row}}"/>
                            <Grid Grid.Column="1" Grid.Row="1" Name="Details" Visibility="Collapsed" >
                                <Custom:DataGridDetailsPresenter />
                            </Grid>
                        </Custom:SelectiveScrollingGrid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Validation.HasError" Value="True" >
                            <Setter Property="Effect">
                                <Setter.Value>
                                    <DropShadowEffect Color="Red" ShadowDepth="0" BlurRadius="20" />
                                </Setter.Value>

                            </Setter>
                            <Setter Property="BorderThickness" Value="3" />
                            <Setter Property="BorderBrush" Value="Red" />
                            <Setter Property="Foreground" Value="Blue" />
                            <Setter Property="FontSize" Value="16" />

                            <Setter Property="Background" TargetName="RowHeader" Value="Red" />
                        </Trigger>

                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="Details" Property="Visibility" Value="Visible" />
                        </Trigger>


                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>




    <!-- Have this style inherit from BasedOn="{StaticResource DataGridRowStyle}" 
    to get some more agressive Error notification  (bright, ugly reds :) 
    -->
    <Style x:Key="DataGridDemoRowStyle" 
              
   TargetType="{x:Type Custom:DataGridRow}">
        <Style.Triggers>
            <Trigger Property="AlternationIndex" Value="2" >
                <Setter Property="Background" Value="{StaticResource RowBackgroundAlternationIndex2Brush}" />
            </Trigger>
            <Trigger Property="AlternationIndex" Value="3">
                <Setter Property="Background" Value="{StaticResource RowBackgroundAlternationIndex3Brush}" />
            </Trigger>

            <Trigger Property="IsSelected" Value="true">
                <Setter Property="Background" Value="{StaticResource RowBackgroundSelectedBrush}" />
            </Trigger>
        </Style.Triggers>
    </Style>



    <!--<Style x:Key="DataGridColumnHeaderStyle" BasedOn="{StaticResource {x:Type Custom:DataGridColumnHeader}}"-->
    <Style x:Key="DataGridColumnHeaderStyle" TargetType="{x:Type Custom:DataGridColumnHeader}"  >
        <Setter Property="Background" Value="#88800080" />
        <Setter Property="Foreground" Value="White" />
        <Style.Triggers>
            <Trigger Property="SortDirection" Value="{x:Null}">
                <Setter Property="Background" Value="{DynamicResource DataGridHeaderBackgroundBrush}" />
                <Setter Property="BorderBrush"  Value="Transparent" />
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsMouseOver" Value="True" />
                    <Condition Property="SortDirection" Value="{x:Null}" />
                </MultiTrigger.Conditions>
                <Setter Property="Background" Value="{StaticResource DataGridHeaderMouseOverBackgroundBrush}" />
                <Setter Property="BorderBrush" Value="{StaticResource DataGridHeaderBorderBrush}" />
            </MultiTrigger>

            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsMouseOver" Value="true" />
                    <Condition Property="SortDirection" Value="{x:Null}" />
                </MultiTrigger.Conditions>
                <Setter Property="Background" Value="{StaticResource DataGridHeaderMouseOverBackgroundBrush}" />
                <Setter Property="BorderBrush" Value="{StaticResource DataGridHeaderBorderBrush}" />
            </MultiTrigger>
            <Trigger Property="SortDirection" Value="Ascending">
                <Setter Property="Background" Value="{StaticResource DataGridHeaderSortedBackgroundBrush}" />
            </Trigger>
            <Trigger Property="SortDirection" Value="Descending">
                <Setter Property="Background" Value="{StaticResource DataGridHeaderSortedBackgroundBrush}" />
            </Trigger>
        </Style.Triggers>
    </Style>


    <!-- Unchanged from generic.xaml. Included here just to avoid Implicit style reference to some external resource  -->
    <Style x:Key="ColumnHeaderGripperStyle" TargetType="{x:Type Thumb}">
        <Setter Property="Width" Value="8"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Cursor" Value="SizeWE"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Padding="{TemplateBinding Padding}"
                    Background="{TemplateBinding Background}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>



    <!--DataGridColumnHeader -->
    <Style x:Key="DatagridColumnHeaderCustomTemplateStyle" 
           TargetType="{x:Type Custom:DataGridColumnHeader}">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="MinWidth" Value="0" />
        <Setter Property="MinHeight" Value="28" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Custom:DataGridColumnHeader}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Border x:Name="BackgroundBorder" BorderThickness="0,1,0,1" 
                                Background="{StaticResource DataGridHeaderSortedBackgroundBrush}" 
                                BorderBrush="{StaticResource DataGridHeaderSortedBorderBrush}" 
                                Grid.ColumnSpan="2" />
                        <ContentPresenter Margin="6,3,6,3" VerticalAlignment="Center" />
                        <Path x:Name="SortArrow" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" Stretch="Fill" 
                              Grid.Column="1" Width="8" Height="6" Fill="White" Margin="0,0,8,0" 
                              VerticalAlignment="Center" RenderTransformOrigin="0.5,0.4" />
                        <Rectangle Width="1" Fill="#AAC377" HorizontalAlignment="Right" Grid.ColumnSpan="2" />

                        <Rectangle Width="1" Margin="0,0,1,0" Fill="#425B10" 
                                   HorizontalAlignment="Right" Grid.ColumnSpan="2" />
                        <Thumb x:Name="PART_LeftHeaderGripper" HorizontalAlignment="Left" 
                               Style="{StaticResource ColumnHeaderGripperStyle}"/>
                        <Thumb x:Name="PART_RightHeaderGripper" HorizontalAlignment="Right" 
                               Style="{StaticResource ColumnHeaderGripperStyle}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="SortDirection" Value="{x:Null}">
                            <Setter TargetName="BackgroundBorder" Property="Background" 
                                    Value="{DynamicResource DataGridHeaderBackgroundBrush}" />
                            <Setter TargetName="BackgroundBorder" Property="BorderBrush"  
                                    Value="Transparent" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="True" />
                                <Condition Property="SortDirection" Value="{x:Null}" />
                            </MultiTrigger.Conditions>
                            <Setter Property="Background" TargetName="BackgroundBorder" 
                                    Value="{StaticResource DataGridHeaderMouseOverBackgroundBrush}" />
                            <Setter Property="BorderBrush" TargetName="BackgroundBorder" 
                                    Value="{StaticResource DataGridHeaderBorderBrush}" />
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="true" />
                                <Condition Property="SortDirection" Value="{x:Null}" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="BackgroundBorder" Property="Background" 
                                    Value="{StaticResource DataGridHeaderMouseOverBackgroundBrush}" />
                            <Setter TargetName="BackgroundBorder" Property="BorderBrush" 
                                    Value="{StaticResource DataGridHeaderBorderBrush}" />
                        </MultiTrigger>

                        <Trigger Property="SortDirection" Value="Ascending">
                            <Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
                            <Setter TargetName="SortArrow" Property="RenderTransform">
                                <Setter.Value>
                                    <RotateTransform Angle="180" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="SortDirection" Value="Descending">
                            <Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger Property="DisplayIndex" Value="0">
                            <Setter Property="Visibility" Value="Collapsed" 
                                    TargetName="PART_LeftHeaderGripper"></Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>



    <Style x:Key="DataGridRowHeaderBackgroundStyle" TargetType="{x:Type Custom:DataGridRowHeader}">
        <Setter Property="Background" Value="Gray" />
    </Style>



    <Style x:Key="RowHeaderGripperStyle" TargetType="{x:Type Thumb}">
        <Setter Property="Height" Value="8"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Cursor" Value="SizeNS"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Padding="{TemplateBinding Padding}"
                  Background="{TemplateBinding Background}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>



    <!--<Style x:Key="DataGridRowHeaderWMaxHeightStyle" TargetType="{x:Type Custom:DataGridRowHeader}">-->
    <Style x:Key="{x:Type Custom:DataGridRowHeader}" TargetType="{x:Type Custom:DataGridRowHeader}">
        <Setter Property="Background" Value="{StaticResource RowHeaderBackgroundBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Custom:DataGridRowHeader}">
                    <Grid>
                        <Custom:DataGridHeaderBorder IsSelected="{TemplateBinding IsRowSelected}"
                                 IsHovered ="{TemplateBinding IsMouseOver}"
                                 IsPressed="{TemplateBinding IsPressed}"
                                 BorderBrush="{Binding RelativeSource={RelativeSource AncestorType={x:Type Custom:DataGrid}}, 
                                    Path=HorizontalGridLinesBrush}"
                                 Background="{TemplateBinding Background}"                                     
                                 BorderThickness="0,1,0,0"
                                 Padding ="{TemplateBinding Padding}"
                                 Orientation="Horizontal"
                                 SeparatorVisibility="{TemplateBinding SeparatorVisibility}"
                                 SeparatorBrush="{TemplateBinding SeparatorBrush}" Margin="0,-1,0,0">

                            <StackPanel Orientation="Horizontal">
                                <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
                                              VerticalAlignment="Center"/>
                                <Control SnapsToDevicePixels="false"
Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type Custom:DataGridRow}}, 
        Path=(Validation.HasError), 
Converter={StaticResource bool2VisibilityConverter}}"
Template="{Binding RelativeSource={RelativeSource AncestorType={x:Type Custom:DataGridRow}}, 
        Path=ValidationErrorTemplate}" 
                 DataContext="{Binding
                    RelativeSource={RelativeSource  AncestorType={x:Type Custom:DataGridRow}},
                    Path=(Validation.Errors)[0].ErrorContent }"                                             
                    >
                                </Control>
                            </StackPanel>
                        </Custom:DataGridHeaderBorder>
                        <Thumb x:Name="PART_TopHeaderGripper"
               VerticalAlignment="Top" Height="3"
               Style="{StaticResource RowHeaderGripperStyle}"/>
                        <Thumb x:Name="PART_BottomHeaderGripper"
               VerticalAlignment="Bottom" Height="3"
               Style="{StaticResource RowHeaderGripperStyle}"/>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" Value="{StaticResource RowHeaderIsMouseOverBrush}" />
                        </Trigger>
                        <Trigger Property="IsRowSelected" Value="True">
                            <Setter Property="Background" Value="{StaticResource RowBackgroundSelectedBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>



    <DrawingBrush x:Key="ErrorTemplateBrush" Viewbox="0,0,19,16.234" ViewboxUnits="Absolute" Stretch="Uniform">
        <DrawingBrush.Drawing>
            <DrawingGroup>
                <DrawingGroup>
                    <DrawingGroup.ClipGeometry>
                        <RectangleGeometry Rect="0,0,19,15.013"/>
                    </DrawingGroup.ClipGeometry>
                    <DrawingGroup.Transform>
                        <MatrixTransform Matrix="1,0,0,1,0,1.221"/>
                    </DrawingGroup.Transform>
                    <GeometryDrawing Brush="#FFFF0000" Geometry="M1.5264391E-07,15.013 C1.5264391E-07,15.013 11.278179,-0.92248435 15.061861,0.04208698 18.845545,1.0066585 14.340995,3.5782006 14.340995,3.5782006 L0.93643624,14.266332 z"/>
                </DrawingGroup>
                <DrawingGroup>
                    <DrawingGroup.Transform>
                        <MatrixTransform Matrix="1,0,0,1,2.832,1.183"/>
                    </DrawingGroup.Transform>
                    <GeometryDrawing Brush="#FFFF0000" Geometry="M0.021026401,0.27456573 C-0.46293162,1.5475728 7.5269286,11.804318 11.647909,14.61601 13.792494,16.079233 7.2223001,5.5069748 6.8034332,5.5069748 6.3845662,5.5069748 0.67633722,-1.4491695 0.021026401,0.27456573 z"/>
                </DrawingGroup>
                <DrawingGroup>
                    <DrawingGroup.Transform>
                        <MatrixTransform Matrix="1,0,0,1,10.032,2.432"/>
                    </DrawingGroup.Transform>
                    <GeometryDrawing Brush="#FFAB0404" Geometry="M5.7970878E-08,4.6522207 C5.7970878E-08,4.6522207 1.6666358,2.7735222 3.4580226,1.5508175 8.0168866,-1.5608194 6.1352206,0.97192629 6.1352206,0.97192629 L0.50724209,5.3830004 z"/>
                </DrawingGroup>
                <DrawingGroup>
                    <DrawingGroup.Transform>
                        <MatrixTransform Matrix="1,0,0,1,0.287,8.6"/>
                    </DrawingGroup.Transform>
                    <GeometryDrawing Brush="#FFAB0404" Geometry="M1.0157332,6.2297077 C1.0157332,6.2297077 4.4261989,2.8647916 6.179524,1.3212826 9.1318492,-1.2777427 8.2156135,0.75924876 8.2156135,0.75924876 L-5.2486112E-08,7.3609995 z"/>
                </DrawingGroup>
                <DrawingGroup>
                    <DrawingGroup.Transform>
                        <MatrixTransform Matrix="1,0,0,1,2.815,1.686"/>
                    </DrawingGroup.Transform>
                    <GeometryDrawing Brush="#FFAB0404" Geometry="M1.2093127,3.1798115 C1.2093127,3.1798115 -0.0013252577,2.3808527 2.2497043E-06,0.019419075 0.00022756806,-0.38130763 4.3080003,5.5527674 4.3080003,5.5527674 L3.8011218,6.059 z"/>
                </DrawingGroup>
                <DrawingGroup>
                    <DrawingGroup.Transform>
                        <MatrixTransform Matrix="1,0,0,1,7.841,8.657"/>
                    </DrawingGroup.Transform>
                    <GeometryDrawing Brush="#FFAB0404" Geometry="M0.68956735,1.51963 C0.68956735,1.51963 -0.93421078,0.24505694 0.80170192,0.0003053632 1.191087,-0.054595244 6.912,7.3039992 6.912,7.3039992 L5.2266264,5.9695358 z"/>
                </DrawingGroup>
            </DrawingGroup>
        </DrawingBrush.Drawing>
    </DrawingBrush>


    <ControlTemplate x:Key="ErrorTemplate2">
        <Grid  MinWidth="20" MinHeight="20" ToolTip="{Binding}">
            <Rectangle Fill="{StaticResource ErrorTemplateBrush}" >
            </Rectangle>
        </Grid>
    </ControlTemplate>

    <Style x:Key="DataGridCellStyle" TargetType="{x:Type Custom:DataGridCell}">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Custom:DataGridCell}">
                    <Border Background="Transparent" 
                  BorderBrush="{TemplateBinding BorderBrush}"  
                  BorderThickness="0" 
                  SnapsToDevicePixels="True">
                        <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--DataTemplate x:Key="RowDetailsTemplate">
        <Grid TextBlock.Foreground="White">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Text="RowDetails Go here"  Grid.Row="0"/>
            <TextBlock Text="{Binding }" Grid.Row="1"/>
        </Grid>

    </DataTemplate-->

    <!-- END CONFIRMED -->













    <!-- DataGrid -->
    <Style x:Key="DataGridStyle1" TargetType="{x:Type Custom:DataGrid}">
        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="BorderThickness" Value="1,1,1,1"/>
        <Setter Property="RowDetailsVisibilityMode" Value="VisibleWhenSelected"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Custom:DataGrid}">
                    <Border SnapsToDevicePixels="True" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                        <ScrollViewer x:Name="DG_ScrollViewer" Focusable="False">
                            <ScrollViewer.Template>
                                <ControlTemplate TargetType="{x:Type ScrollViewer}">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="*"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <Button Width="{Binding Path=CellsPanelHorizontalOffset, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type Custom:DataGrid}}}" Focusable="False"
                                                Command="{x:Static Custom:DataGrid.SelectAllCommand}">
                                            <Button.Visibility>
                                                <Binding Path="HeadersVisibility" RelativeSource="{RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type Custom:DataGrid}}">
                                                    <Binding.ConverterParameter>
                                                        <Custom:DataGridHeadersVisibility>All</Custom:DataGridHeadersVisibility>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </Button.Visibility>
                                            <Button.Template>
                                                <ControlTemplate TargetType="{x:Type Button}">
                                                    <Grid>
                                                        <Rectangle Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" x:Name="Border" SnapsToDevicePixels="True"/>
                                                        <Polygon Fill="#FF000000" Stretch="Uniform" HorizontalAlignment="Right" Margin="8,8,3,3" x:Name="Arrow" VerticalAlignment="Bottom" Opacity="0.15" Points="0,10 10,10 10,0"/>
                                                    </Grid>
                                                    <ControlTemplate.Triggers>
                                                        <Trigger Property="IsMouseOver" Value="True">
                                                            <Setter Property="Stroke" TargetName="Border" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
                                                        </Trigger>
                                                        <Trigger Property="IsPressed" Value="True">
                                                            <Setter Property="Fill" TargetName="Border" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
                                                        </Trigger>
                                                        <Trigger Property="IsEnabled" Value="False">
                                                            <Setter Property="Visibility" TargetName="Arrow" Value="Collapsed"/>
                                                        </Trigger>
                                                    </ControlTemplate.Triggers>
                                                </ControlTemplate>
                                            </Button.Template>

                                        </Button>
                                        <Custom:DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter" Grid.Column="1">
                                            <Custom:DataGridColumnHeadersPresenter.Visibility>
                                                <Binding Path="HeadersVisibility" RelativeSource="{RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type Custom:DataGrid}}">
                                                    <Binding.ConverterParameter>
                                                        <Custom:DataGridHeadersVisibility>Column</Custom:DataGridHeadersVisibility>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </Custom:DataGridColumnHeadersPresenter.Visibility>
                                        </Custom:DataGridColumnHeadersPresenter>
                                        <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" Grid.ColumnSpan="2" Grid.Row="1" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False"/>
                                        <ScrollBar x:Name="PART_VerticalScrollBar" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Grid.Column="2" Grid.Row="1" Orientation="Vertical" ViewportSize="{TemplateBinding ViewportHeight}" Maximum="{TemplateBinding ScrollableHeight}" Value="{Binding Path=VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"/>
                                        <Grid Grid.Column="1" Grid.Row="2">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="{Binding Path=NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type Custom:DataGrid}}}"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <ScrollBar x:Name="PART_HorizontalScrollBar" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Grid.Column="1" Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" Maximum="{TemplateBinding ScrollableWidth}" Value="{Binding Path=HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"/>
                                        </Grid>
                                    </Grid>
                                </ControlTemplate>
                            </ScrollViewer.Template>
                            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsGrouping" Value="True">
                <Setter Property="ScrollViewer.CanContentScroll" Value="False"/>
            </Trigger>
        </Style.Triggers>
    </Style>






    <!--  -->
    <Style x:Key="DataGridDemoStyle"  TargetType="{x:Type Custom:DataGrid}">
        <Setter Property="AlternatingRowBackground" Value="{StaticResource RowBackgroundAlternateBrush}" />
        <Setter Property="BorderBrush" Value="#FF688CAF"/>
        <Setter Property="Background" Value="{DynamicResource bearBrush}" />
        <Setter Property="ColumnHeaderHeight" Value="50" />
        <Setter Property="HeadersVisibility" Value="All" />
        <Setter Property="RowBackground" Value="{StaticResource RowBackgroundBrush}" />
        <Setter Property="AlternationCount" Value="4" />
        <Setter Property="RowStyle" Value="{StaticResource DataGridDemoRowStyle}" />

        <Setter Property="RowHeaderWidth" Value="50" />
        <Setter Property="RowHeight" Value="22" />
        <Setter Property="HorizontalGridLinesBrush" Value="{StaticResource DataGridHorizontalLinesBrush}" />
        <Setter Property="CellStyle" Value="{StaticResource DataGridCellStyle}" />
       <!--  <Setter Property="RowDetailsTemplate" Value="{StaticResource RowDetailsTemplate}" />-->
        <!-- The below line did not work.. I ended up needing an Implicit Style -->
        <!-- <Setter Property="RowHeaderStyle" Value="{StaticResource DataGridRowHeaderWMaxHeightStyle}" /> -->

        <Setter Property="RowValidationErrorTemplate" Value="{StaticResource ErrorTemplate2}" />
        <Setter Property="ColumnHeaderStyle" Value="{StaticResource DatagridColumnHeaderCustomTemplateStyle}" />


    </Style>


    <!--
          COLUMN SELECTION:
          These resources add a button to the column header that will select
          all of the cells in that column.
        -->
    <!-- i dont know what is this -->
    <!--<Style x:Key="ColumnHeaderGripperStyle1" TargetType="{x:Type Thumb}">
        <Setter Property="Width" Value="8"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Cursor" Value="SizeWE"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Padding="{TemplateBinding Padding}"
                    Background="{TemplateBinding Background}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="SelectColumnButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="VerticalAlignment" Value="Bottom" />
        <Setter Property="Height" Value="10" />
        <Setter Property="ClickMode" Value="Press" />
        <Setter Property="Cursor" Value="ScrollS" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border Background="Transparent" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type Custom:DataGridColumnHeader}" TargetType="{x:Type Custom:DataGridColumnHeader}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Custom:DataGridColumnHeader}">
                    <Grid>
                        <Custom:DataGridHeaderBorder SortDirection="{TemplateBinding SortDirection}"
                                     IsHovered="{TemplateBinding IsMouseOver}"
                                     IsPressed="{TemplateBinding IsPressed}"
                                     IsClickable="{TemplateBinding CanUserSort}"
                                     Background="{TemplateBinding Background}"
                                     BorderBrush="{TemplateBinding BorderBrush}"
                                     BorderThickness="{TemplateBinding BorderThickness}"
                                     Padding ="{TemplateBinding Padding}">
                            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
                        </Custom:DataGridHeaderBorder>

                        <Thumb x:Name="PART_LeftHeaderGripper"
                   HorizontalAlignment="Left"
                   Style="{StaticResource ColumnHeaderGripperStyle}"/>
                        <Thumb x:Name="PART_RightHeaderGripper"
                   HorizontalAlignment="Right"
                   Style="{StaticResource ColumnHeaderGripperStyle}"/>
                        <Button x:Name="SelectColumnButton" 
                          Style="{StaticResource SelectColumnButtonStyle}"
                          Click="SelectColumn"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

-->
    <!--
          END OF COLUMN SELECTION:
        -->
    
    
    
    

    <DrawingBrush x:Key="DrawingBrush1" Viewbox="0,0,1191,74.0003926380368" ViewboxUnits="Absolute">
    	<DrawingBrush.Drawing>
    		<GeometryDrawing Brush="#FF1A1717">
    			<GeometryDrawing.Geometry>
    				<RectangleGeometry Rect="3,3,1185,68.0003926380368"/>
    			</GeometryDrawing.Geometry>
    		</GeometryDrawing>
    	</DrawingBrush.Drawing>
    </DrawingBrush>
</ResourceDictionary> 